package com.hyts.aop.facade;

import com.hyts.aop.proxy.ProxyBuilder;

/**
 * project-name:coffice-toolbox
 * package-name:com.hyts.aop.facade
 * author:Libo/Alex
 * create-date:2019-07-13 12:27
 * copyright:libo-hyts-github
 * email:libo2dev@aliyun.com
 * description:此类主要用于:
 */
public interface AopJdkExecutor {

    /**
     * <b>executeJdkAopBean</b>
     * <p>执行AOP面向切面变成开发操作</p>
     * @param object 参数传递
     * @return 返回
     * @exception
     */
    @SuppressWarnings("unchecked")
    static  <T,V> V executeJdkAopBean(T object,Class<V> interfaceClass) {
        return (V) new ProxyBuilder(object).build(interfaceClass);
    }
    /**
     * <b>executeJdkAopBean</b>
     * <p>执行AOP面向切面变成开发操作</p>
     * @param object 参数传递
     * @return 返回
     * @exception
     */
    @SuppressWarnings("unchecked")
    static  <T,V> V executeJdkAopBean(T object,Object aopWeaveObj,Class<V> interfaceClass) {
        return (V) new ProxyBuilder(object,aopWeaveObj).build(interfaceClass);
    }
    /**
     * @param object
     * @param aopWeaveObj
     * @param interfaceClass
     * @param <T>
     * @param <V>
     * @return
     */
    static  <T,V> V executeJdkAopBean(T object,Object[] aopWeaveObj,Class<V> interfaceClass) {
        return (V) new ProxyBuilder(object,aopWeaveObj).build(interfaceClass);
    }
    /**
     * <b>executeJdkAopObject</b>
     * <p>执行AOP面向切面变成开发操作</p>
     * @param object
     * @return
     * @exception
     */
    static Object executeJdkAopObject(Object object) {
        return new ProxyBuilder(object).build();
    }

}
